<?php

class Controller extends Smarty{

	public function __construct(){
		$this->template_dir = MODEL_PATH.'View/'.CONTROLLER.'/';
		$this->compile_dir = MODEL_PATH.'View/'.CONTROLLER.'/Compile/';
		$this->left_delimiter = '{UY:';
		is_dir($this->template_dir) or mkdir($this->template_dir,0755,true);
		is_dir($this->compile_dir) or mkdir($this->compile_dir);
		if(method_exists($this, '__Init'))$this->__Init();
	}

	public function success($msg='成功',$url=null){
		$this->template_dir = MODEL_PATH.'View/Public/';
		$this->compile_dir = MODEL_PATH.'View/Public/Compile/';
		$this->assign('msg',$msg);
		$this->assign('url',$url);
		$this->display('success.html');
		die;
	}

	public function error($msg='失败',$url=null){
		$this->template_dir = MODEL_PATH.'View/Public/';
		$this->compile_dir = MODEL_PATH.'View/Public/Compile/';
		$this->assign('msg',$msg);
		$this->assign('url',$url);
		$this->display('error.html');
		die;
	}
	
}

?>